#ifndef UDP_BACKEND_H
#define UDP_BACKEND_H

#include <QObject>
#include <QUdpSocket>

class UDPBackend : public QObject
{
    Q_OBJECT
  private:
    QUdpSocket *socket;

  public:
    explicit UDPBackend(QObject *parent = nullptr);
    ~UDPBackend();
    bool Init(unsigned short port);
    void SendFrame(const QByteArray &frameData, const QHostAddress &address, unsigned short port);

  private:
    void OnReceiveDiagram();
  signals:
    void OnReceiveFrame(const QByteArray &frameData);
};

#endif // UDP_BACKEND_H
